home *** CD-ROM | disk | FTP | other *** search
/ Quarterdeck Expanded Memory Manager 7.0 / Quarterdeck Expanded Memory Manager v7.0.img / TECHNOTE.QIP / BUS-MAST.TEC next >
Text File  |  1993-06-18  |  11KB  |  236 lines

  1.  
  2.               USING BUS-MASTERING DEVICES WITH QEMM
  3.  
  4.  
  5.   This QEMM 7 technote is an abridged version of a technical
  6.   bulletin available through our standard support channels.  The
  7.   information contained in this version pertains ONLY to QEMM
  8.   version 7.0.  If you need information relating to earlier versions
  9.   of QEMM or if you are interested in a lengthier discussion of this
  10.   subject, you can obtain the unabridged version from the following
  11.   sources:
  12.  
  13.   Quarterdeck Technical Support BBS:  BUS-MAST.TEC
  14.                          CompuServe:  BUSMAS.TEC
  15.                               Q/FAX:  #121
  16.  
  17.  
  18.   Subject: Notes on bus-mastering devices and why they may require
  19.   a Virtual DMA Services (VDS) driver on 386 and higher machines in
  20.   Virtual 8086 mode.  Owners of SCSI hard drives should read this
  21.   note.
  22.  
  23.   PLEASE NOTE:  All references to 386 computers or to the 80386
  24.   processor, unless otherwise stated, refer to 386 AND HIGHER
  25.   processors.
  26.  
  27.        BUS-MASTERING DEVICES, QEMM AND VIRTUAL DMA SERVICES
  28.  
  29.   Q: What is a bus-mastering device and what problems might be seen
  30.   when using one?
  31.  
  32.   A bus-mastering device does its own direct memory addressing
  33.   (DMA) without going through the machine's processor or its DMA
  34.   controller.  The most common bus-mastering devices we see
  35.   currently are SCSI hard disk controllers, but, technically, other
  36.   types of devices could be bus-mastering as well.  We have seen
  37.   bus-mastering ESDI disk controllers and an increasing number of
  38.   bus-mastering network cards as well.  The problem seen with bus-
  39.   mastering devices is that while they are high-performance devices
  40.   and quite often found on 386 and higher systems, they are
  41.   unfortunately, in their design, incompatible with one of the most
  42.   common operating modes of the 80386 processor -- the Virtual 8086
  43.   mode.
  44.  
  45.   If you are using a bus-mastering device on a 386 that is in
  46.   Virtual 8086 mode and memory paging is occurring (e.g. when QEMM
  47.   is providing High RAM, when QEMM is providing expanded memory, or
  48.   when the processor is switching from one virtual machine to
  49.   another), your machine will probably hang when you use the bus-
  50.   mastering device.
  51.  
  52.   Q: How can the problem with running bus-mastering devices in
  53.   Virtual 8086 mode be corrected?
  54.  
  55.   There are four possible solutions:
  56.  
  57.   1)  THE BEST SOLUTION:  Contact the maker of your bus-mastering
  58.   device and see if they have a driver available which supports the
  59.   VDS (Virtual DMA Services) specification.  VDS is now an industry-
  60.   wide specification supported by IBM, Microsoft and Quarterdeck,
  61.   as well as many other hardware and software suppliers.  A VDS
  62.   driver allows a bus-mastering device to find the real physical
  63.   address of its data when the processor is in Virtual 8086 mode.
  64.  
  65.   QEMM versions 5.00 and later support the VDS specification.  A
  66.   VDS driver provides the best solution to this problem in terms of
  67.   reliability, speed and memory efficiency.  A VDS driver may be
  68.   loaded into High RAM if it appears in the CONFIG.SYS file after
  69.   the QEMM386.SYS line; you may need a DB= parameter on the
  70.   QEMM386.SYS line to accomplish this; see section 5 below.
  71.  
  72.   2) Similarly, the drivers of many bus-mastering hard disks have
  73.   proprietary buffering options.  Check the documentation for your
  74.   disk controller to see if the driver has a parameter to set up
  75.   buffering for disk operations.  Some drivers also support
  76.   parameters that are specific to 386 operations. For example, the
  77.   early Adaptec drivers SCSIHA.SYS and AHA1540.SYS included both
  78.   386 and disk buffering options invoked by the parameters "/v386"
  79.   and "/b:64." "/v386" stands for virtual 386; "/b:64" allocates a
  80.   64k buffer, for DMA.
  81.  
  82.   Unlike the drivers in (1) above, these drivers do not provide VDS
  83.   services. If you are using a driver such as this, make sure that
  84.   it is not loaded high. The purpose of such a driver is to provide
  85.   buffering into physical addresses that are the same as logical
  86.   addresses; if the program is loaded high, its buffer will be in
  87.   logical addresses that are not the same as their physical
  88.   addresses.  Please read the section below titled "Making Sure
  89.   Your Device Driver Loads Low".
  90.  
  91.   3)  Check the documentation for your bus-mastering device and see
  92.   if it can be configured to use the BIOS or any one of the
  93.   standard DMA channels.  QEMM can correct the problem if the BIOS
  94.   or standard DMA channels are used.
  95.  
  96.   4)  Bus-mastering hard drives can also cause problems for
  97.   Microsoft Windows 3. Microsoft's solution is in its SmartDrive
  98.   disk cache.  SMARTDRV (and other disk caches) contain code that
  99.   can buffer direct memory access.  Since QEMM and its VDS services
  100.   are almost completely disabled when you enter 386 Enhanced mode,
  101.   this is a good thing.  If you have a bus-mastering disk
  102.   controller and wish to run Microsoft Windows in 386 Enhanced mode
  103.   while loading any programs high, you must use SmartDrive.
  104.  
  105.   a) As of this writing, Microsoft Windows 3.1 provides you with a
  106.   copy of SmartDrive v. 4.0 and DOS 6 ships with version 4.1.
  107.   These versions have two functions: to provide disk caching,
  108.   through a module loaded in AUTOEXEC.BAT, and to provide buffering
  109.   for SCSI hard drives, through a module loaded in CONFIG.SYS.  If
  110.   you are using Windows 3.1 and a bus-mastering hard drive, and you
  111.   are not using any of the options numbered 1 through 3 above, make
  112.   sure that the following line appears in CONFIG.SYS:
  113.  
  114.      DEVICE=C:\WINDOWS\SMARTDRV.EXE /DOUBLE_BUFFER
  115.  
  116.   (If your path to SmartDrive differs, change C:\WINDOWS above to
  117.   the appropriate path.)
  118.  
  119.   Please read the section below titled "Making Sure Your Device
  120.   Driver Loads Low".
  121.  
  122.   b) Windows 3.0 and DOS 5 shipped with SmartDrive version 3 or
  123.   lower.  If you are using one of these versions of SmartDrive,
  124.   make sure that the following line appears in your CONFIG.SYS
  125.   file:
  126.  
  127.    DEVICE=C:\WINDOWS\SMARTDRV.SYS
  128.  
  129.   (If your path to SmartDrive differs, change C:\WINDOWS above to
  130.   the appropriate path.)
  131.  
  132.   Please read the section below titled "Making Sure Your Device
  133.   Driver Loads Low".
  134.  
  135.   5) QEMM's DB=xx (DISKBUF=xx) parameter can prevent QEMM-SCSI
  136.   problems at the expense of a little conventional memory.  "xx" is
  137.   the number of K used for buffering.  Any value for xx is
  138.   sufficient to correct the problem.  DISKBUF=2 would be fine for
  139.   most cases.  Configuring QEMM with a DISKBUF greater than 2 might
  140.   improve disk performance, but setting DISKBUF to more than 10 is
  141.   probably a waste of memory.
  142.  
  143.   QEMM version 7 automatically creates a 2K disk buffer when it
  144.   detects an addressing problem with a bus-mastering hard drive
  145.   controller.  It will only do so, however, when QEMM itself is
  146.   loaded from that bus-mastering hard drive.  If you load a driver
  147.   that provides VDS (Virtual DMA Services) support BEFORE you load
  148.   QEMM, QEMM will not create the disk buffer.  In cases where QEMM
  149.   automatically creates this buffer, it does not add a DISKBUF
  150.   parameter to the QEMM386.SYS line.
  151.  
  152.   QEMM's automatic detection of bus-mastering hard disks is active
  153.   only when the RAM parameter is specified on the QEMM386.SYS line
  154.   in the CONFIG.SYS file.  You can disable QEMM's automatic disk
  155.   buffering by using the QEMM386.SYS parameters DISKBUF=0, but there
  156.   is usually no reason to disable this feature.  If you have a bus-
  157.   mastering hard disk that you do not load QEMM from, QEMM will not
  158.   detect bus-mastering conflicts with it, and you must either use
  159.   the disk controller's VDS support or specify the DISKBUF=nn.
  160.  
  161.   Use of the DB= parameter will not help in cases where the bus-
  162.   mastering device is something other than a hard disk.  If your
  163.   bus-mastering device is something other than a hard disk the
  164.   solutions above, especially #1, are your only options.
  165.  
  166.   If your bus-mastering hard disk controller uses a VDS device
  167.   driver that is loaded after QEMM386.SYS, QEMM will still create a
  168.   2K disk buffer, because the VDS support will not be in place at
  169.   the time that QEMM loads.  This disk buffer will be necessary in
  170.   most circumstances, because the Optimize program would otherwise
  171.   fail when it tried to load the VDS driver into High RAM.
  172.   However, you may wish in this circumstance to reduce the size of
  173.   the disk buffer as much as possible by placing the DISKBUF=1
  174.   parameter on the QEMM386.SYS device driver line.  The smaller
  175.   disk buffer is preferable here, because the disk buffer will
  176.   never again be used after the VDS driver loads, and a bigger disk
  177.   buffer uses valuable conventional memory.
  178.  
  179.   If you are both disabling automatic disk buffering (with the
  180.   DISKBUF=0 parameter) and creating a disk buffer for the page
  181.   frame (with the DISKBUFFRAME=xx parameter), you must place the
  182.   DISKBUF=0 parameter before the DISKBUFFRAME=xx parameter on the
  183.   QEMM386.SYS line in the CONFIG.SYS file.  If you reverse this
  184.   ordering, automatic disk buffering will still be disabled, but
  185.   the disk buffer for the page frame will not be created.
  186.  
  187.  
  188.   MAKING SURE YOUR DEVICE DRIVER LOADS LOW
  189.  
  190.   Q. I've read the sections above.  I don't have a VDS driver, and
  191.   I think that my proprietary device driver or my disk cache should
  192.   be loaded low.  How do I prevent it from loading high?
  193.  
  194.   For double-buffering to work properly, the device driver for your
  195.   bus-mastering hardware must be loaded in conventional memory,
  196.   where physical and logical addresses are almost always the same.
  197.   You must therefore make sure that it loads low if you are
  198.   depending on it to provide DMA buffering. We will use SMARTDRV as
  199.   an example of such a program; change the instructions below to
  200.   fit your device driver.
  201.  
  202.   Ensure that there is no LOADHI command preceding SMARTDRV on the
  203.   line which loads it.
  204.  
  205.   OPTIMIZE will very likely try to load SmartDrive high, unless you
  206.   tell OPTIMIZE not to do so.  This is most easily done in the
  207.   following way:
  208.  
  209.   1) Using a text editor, create a text file called OPTIMIZE.EXC in
  210.   the QEMM directory.  Note that EXC (not EXE) is the extension on
  211.   the file name.  If such a file exists already, simply open it for
  212.   editing.
  213.  
  214.   2) Put a line in OPTIMIZE.EXC that says:
  215.  
  216.      SMARTDRV
  217.  
  218.   Do not specify a pathname nor an extension to the filename.
  219.  
  220.   3) From now on, OPTIMIZE will not affect the SMARTDRV line in
  221.   either CONFIG.SYS or AUTOEXEC.BAT.  As long as SMARTDRV is not
  222.   being loaded high already, it will not load high.
  223.  
  224.   It is possible that your bus-mastering device was shipped with a
  225.   VDS driver. Bus-mastering hard disk controllers are starting to
  226.   ship with drivers that make VDS calls, and these drivers do not
  227.   require the DB parameter or any other buffering.  We expect that
  228.   most bus-mastering devices will eventually include VDS drivers
  229.   and therefore will not exhibit any problems when run in Virtual
  230.   8086 mode.
  231.  
  232.   ******************************************************************
  233.   *This technical note may be copied and distributed freely as long
  234.   *as it is distributed in its entirety and it is not distributed
  235.   *for profit.  Copyright (C) 1990-93 by Quarterdeck Office Systems
  236.   ************************ E N D   O F   F I L E *******************